<?php
/**
 * Created by PhpStorm.
 * User: idcu
 * Date: 2016/3/16
 * Time: 9:39
 */
namespace Oa\Model;
use IDCU\Model\RelationModel;

class RunModel extends RelationModel
{
    protected $connection = array(
        'db_type'       =>  'mysql',
        'db_host'       =>  'oa.sxqtwy.com',
        'db_port'       =>  '3336',
        'db_name'       =>  'TD_OA',
        'db_user'       =>  'crm',
        'db_pwd'        =>  '!@#sa2015',
        'db_charset'    =>  'utf8',
        'db_debug'      =>  true,
    );
    protected $tablePrefix = '';
    protected $tableName = 'flow_run';
    protected $_link = array(
        'OaDept' => array(
            'mapping_type' => self::BELONGS_TO,
            'mapping_name' => 'dept',
            'foreign_key'  => 'BEGIN_DEPT'
        ),
        'OaUser' => array(
            'mapping_type' => self::BELONGS_TO,
            'mapping_name' => 'user',
            'foreign_key'  => 'BEGIN_USER'
        ),
        'OaPrcs' => array(
            'mapping_type' => self::HAS_MANY,
            'mapping_name' => 'prcss',
            'foreign_key'  => 'RUN_ID',
        )
    );
}